/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.protocol.passive;

import info.peigen.hotpot.common.core.enums.StubType;
import info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.*;

/**
 * <b>(DianlanFireUnitStatusAlarm)</b>
 * <p>
 * GBT-27930 充电桩与
 * 帧类型码 0xED(237)
 * 序列号域
 * 数据长度 12(18)
 * 帧校验域
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/8/19
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class DianlanFireUnitStatusAlarm {
    /** 桩编码 */
    @DianlanProtocol(length = 7, start = 0, end = 7, dataType = BCD)
    String   stubNo;
    /** 桩类型 */
    @DianlanProtocol(length = 1, start = 7, end = 8, dataType = ENUM)
    StubType stubType;
    /** 充电枪数量 */
    @DianlanProtocol(length = 1, start = 8, end = 9, dataType = BIN)
    Integer  chargingCount;
    /** 充电枪号 */
    @DianlanProtocol(length = 1, start = 9, end = 10, dataType = BCD)
    String   chargingPortNo;
    /** 电池箱号 */
    @DianlanProtocol(length = 1, start = 10, end = 11, dataType = BCD)
    String   batteryBoxNo;
    /**
     * 系统预警级别，表示灭火级别
     * 0代表正常，
     * 从1-4分别代表火情危险程度，
     * 4级危险度最高
     */
    @DianlanProtocol(length = 1, start = 11, end = 12, dataType = BIT, dataTypeClass = "DianlanFireUnitSystemAlarmLevelBits")
    String   systemAlarmLevel;
    /** 预留位 */
    @DianlanProtocol(length = 4, start = 12, end = 16, dataType = BIN)
    String   reservePlace;
    /** 消息计数器 */
    @DianlanProtocol(length = 1, start = 16, end = 17, dataType = BCD)
    String   messageCounter;
    /** 故障码 */
    @DianlanProtocol(length = 1, start = 17, end = 18, dataType = BIT, dataTypeClass = "DianlanFireUnitFaultCodeBits")
    String   faultCode;


}